<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="com.proj.User" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="sys/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="sys/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="sys/Css/style.css" />
    <script type="text/javascript" src="sys/Js/jquery.js"></script>
    <script type="text/javascript" src="sys/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="sys/Js/bootstrap.js"></script>
    <script type="text/javascript" src="sys/Js/ckform.js"></script>
    <script type="text/javascript" src="sys/Js/common.js"></script>

 

    <style type="text/css">
        body {
            padding-bottom: 40px;
            
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="UserServlet?type=getUserByName" method="post">    
    用户名称：
    <input type="text" name="login_id" id="login_id"class="abc input-default" placeholder="" value="">&nbsp;&nbsp;  
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; 
    <!-- <button type="button" class="btn btn-success" id="addnew">新增用户</button> -->
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>用户id</th>
        <th>用户名称</th>
        <th>操作</th>
    </tr>
    </thead>
       <%
       List<User> list = (List<User>)request.getAttribute("list");
       for(User u:list){%>
	     <tr>
            <td><%=u.getA_id() %></td>
            <td><a href="UserServlet?type=getUserById&id=<%=u.getId()%>"><%=u.getA_id()%></a></td>
            <td>
            	<button class="btn btn-danger btn-xs btn-primary"><i class="fa fa-trash-o "></i> 
            			<a href="UserServlet?type=delUserById&id=<%=u.getId() %>" style="color:#ffffff;">删除</a>
       			</button>            	
                <button type="button" class="btn btn-success "  style="float:right">
                		<a href="UserServlet?type=addUserById&id=<%=u.getId() %>" style="color:#ffffff;">新增</a>
           		</button>         
            </td>
        </tr>
        <%} %>
</table>
</body>
</html>
<script>
    $(function () {
        

		$('#addnew').click(function(){

				window.location.href="add.html";
		 });


    });

	function del(id)
	{
		
		
		if(confirm("确定要删除吗？"))
		{
		
			var url = "index.html";
			
			window.location.href=url;		
		
		}
	
	
	
	
	}
</script>